function validateToSubmit(){
	var registerForm = $('#registerForm');
	var un = $('#userName').val();
	var first = $('#first').val();
	var second = $('#second').val();
	var e_mail = $('#e_mail').val();
	var gpQues = $('#gpQues').val();
	var gpAnsw = $('#gpAnsw').val();
	var checkcode = $('#checkcode').val();
	var reg = /^\s+|\s+$/g;
	un = un.replace(reg,"");
	first = first.replace(reg,"");
	second = second.replace(reg,"");
	e_mail = e_mail.replace(reg,"");
	gpAnsw = gpAnsw.replace(reg,"");
	checkcode = checkcode.replace(reg,"");
	var isOK = 0;
	if(un!=""){
		isOK++;
		$('#span_userName').text("");
	}else{
		$('#span_userName').text("账号不能为空");
	}
	if(first!=""){
		isOK++;
		$('#span_first').text("");
		if(second!=""){
			$('#span_second').text("");
			if(first==second){
				isOK++;
			}else{
				$('#span_second').text("两次密码不相同");
			}
		}else{
			$('#span_second').text("确认密码不能为空");
		}
	}else{
		$('#span_first').text("密码不能为空");
	}
	if(e_mail!=""){
		var reg_email = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		$('#span_e_mail').text("");
		if(reg_email.test(e_mail)){
			isOK++;
		}else{
			$('#span_e_mail').text("邮箱格式不正确");
		}
	}else{
		$('#span_e_mail').text("邮箱不能为空");
	}
	if(gpQues!=""){
		isOK++;
		$('#span_gpQues').text("");
	}else{
		$('#span_gpQues').text("请选择密码提示问题");
	}
	if(gpAnsw!=""){
		isOK++;
		$('#span_gpAnsw').text("");
	}else{
		$('#span_gpAnsw').text("请填写密码提示答案");
	}
	if(checkcode!=""){
		isOK++;
		$('#span_checkcode').text("");
	}else{
		$('#span_checkcode').text("验证码不能为空");
	}
	if(isOK==7){
		registerForm.submit();
	}
}
function changeVCode(){
	var code = document.getElementById("checkimg");
	var newdate = (new Date()).getTime();
	code.src = "util/identifycode.jsp?rnd="+newdate;
}
function verifyUN(){
	var un = $('#userName').val();
	var showdata = $('#span_userName');
	var reg = /^\s+|\s+$/g;
	un = un.replace(reg,"");
	if(un!=""){
		$.post('UCVerifyName',{username:encodeURI(encodeURI(un))},function callback(data){
			if(data!=null&&data!=""){
				showdata.text(data);
			}else{
				alert("系统错误！");
			}
		});
	}else{
		showdata.text("账号不能为空！");
	}
}